package com.cn.controller;

import com.cn.api.ApiResult;
import com.cn.pojo.shop.ShopCtc;
import com.cn.service.ShopCtcService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 类目信息
 */
@RestController
@RequestMapping("/ctc")
public class CtcController {

    @Autowired
    private ShopCtcService shopCtcService;

    /**
     * 查询分类信息
     * @return
     */
    @GetMapping("/queryCtc")
    public ApiResult queryCtc(){
        return shopCtcService.queryCtc();
    }

    /**
     * 修改数据信息
     * @return
     */
    @PutMapping("/updateCtc")
    public ApiResult updateCtc(@RequestBody ShopCtc shopCtc,Integer id){
        return shopCtcService.updateCtc(shopCtc,id);
    }

    /**
     * 删除下级id
     * @param id
     * @return
     */
    @DeleteMapping("/deleteCtc")
    public ApiResult deleteCtc(@PathVariable("id") Integer id){
        return shopCtcService.deleteCtc(id);
    }


    /**
     * 类都多选查询
     * @return
     */
    @GetMapping("/querySelectCtc")
    public ApiResult querySelectCtc(){
        return shopCtcService.querySelectCtc();
    }
}
